using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using FBGraph.Web.Security;

namespace FBGraph.Demos.AspNetMvc.Controllers
{
    public class ExtendedPermissionsController : BaseController
    {
        public ActionResult Index()
        {
            return View(Enum.GetValues(typeof(ExtendedPermission)).Cast<ExtendedPermission>());
        }

        public ActionResult Auth(ExtendedPermission scope)
        {
            return Redirect(FBGraphAuthenticationHelper.PrepareAuthUrl(FbContext, "/account/postauthorize", Request.UrlReferrer == null ? "~/" : Request.UrlReferrer.ToString(), scope, false));
        }
    }
}